package com.motorhome.api.service.impl;

import com.motorhome.api.dao.CarDao;
import com.motorhome.api.domain.Car;
import com.motorhome.api.service.CarService;
import com.motorhome.base.dao.Pager;
import com.motorhome.base.util.Result;
import com.motorhome.base.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: John
 */
@Service
public class CarServiceImpl implements CarService {

    @Autowired
    private CarDao carDao;

    @Override
    public Result getCarList(String page, String pageSize) {

        if (StringUtil.isBlank(page)) {
            page = "1";
        }
        if (StringUtil.isBlank(pageSize)) {
            pageSize = "20";
        }

        List<Car> carList = carDao.getAllCarList();

        return new Result(0, "成功", carList);
    }

}
